www.gusucode.com > 落叶冰点万能企业网站内容管理系统 V9.1 > 落叶冰点万能企业网站内容管理系统 V9.1\code\admin\adminTemplates_qiye\D_ajax_get_all_pages_list_pic.asp

    <%


'**************************************************************
' 新动软网站管理系统
' 官方网站: http://www.aspcpu.com
' 系统作者: 阮丁远(网名:天下程序)
' Copyright 新动软网站管理系统 版权所有
'**************************************************************


%>









<%

dir_set="../../"



Server.ScriptTimeout=9999999


session.timeout=600


%>


<!--#include file=../../inc/conn.asp-->






<!--#include file=../inc/checkadmin2.asp-->

<!--#include file=../../inc/functionFiless.asp-->






<%

set filea=new Cls_FSO
set fileb=new DosAsp 

ppath=request("ppath")

if ppath="" then 
sssd=""

else

sssd="/"
end if


dim haved,num_folders,flst()



haved=0



function list_folder_s_files(iq)

if iq="root" then
npath=""


else
npath=flst(iq,0)



end if









ss3=filea.ShowFolderList(server.mappath("../../templates/"&ppath&sssd&npath))

ss4=filea.ShowFileList(server.mappath("../../templates/"&ppath&sssd&npath))











if ss3=-1 or ss3="" then

nofolder=1
numf1=0
else

ss3=left(ss3,len(ss3)-1)'去掉最后一个|号



'处理文件夹

fl1=split(ss3,"|")


numf1=ubound(fl1)+1


end if

if ss4=-1 or ss4="" then

nofiles=1

numf2=0

else
ss4=left(ss4,len(ss4)-1) '去掉最后一个|号



'处理文件

fl2=split(ss4,"|")



numf2=ubound(fl2)+1


end if







'response.write numf1+numf2

if haved=0 then

old_len=0
else


old_len=ubound(flst)+1






end if


if old_len+(numf1+numf2)>=1 then haved=1




redim cache_list(old_len,3)

for k=0 to old_len-1

cache_list(k,0)=flst(k,0)

cache_list(k,1)=flst(k,1)

cache_list(k,2)=flst(k,2)



next

redim flst(old_len+(numf1+numf2)-1,3)


for k=0 to old_len-1

flst(k,0)=cache_list(k,0)

flst(k,1)=cache_list(k,1)

flst(k,2)=cache_list(k,2)




next





for iw=old_len to (old_len+numf1-1)




ii=iw-old_len




sssf="/"
if npath="" then sssf=""



flst(iw,0)=npath&sssf&fl1(ii)



flst(iw,1)=0 '=0表示文件夹
flst(iw,2)=0 '=0表示文件夹未展开为文件,=1表示文件夹已展开为文件


next

for i=old_len+numf1 to old_len+numf1+numf2-1

ii=i-(old_len+numf1)


sssf="/"
if npath="" then sssf=""



flst(i,0)=npath&sssf&fl2(ii)


flst(i,1)=1 '=1表示文件
flst(i,2)=1 

next





'test----------------------------------
'response.write "<br>called end "
'for iii=0 to ubound(flst)
'response.write "<br> <font color=#00ffff>iii="&iii&":"&flst(iii,0)&" is_opend:"&flst(iii,2)&"</font><br>"
'next
'end  test-----------------------------




end function












function zhangkai_all_folder()



num_folders=0


if haved=0 then

a_len=-1
else


a_len=ubound(flst)




end if



for iq=0 to a_len





'response.write a_len






if flst(iq,1)=0 and flst(iq,2)=0 then








flst(iq,2)=1
call list_folder_s_files(iq)

num_folders=num_folders+1


'递归遍历
call zhangkai_all_folder()



if haved=0 then

a_len=-1
else


a_len=ubound(flst)
end if


end if






next



end function




function list_all_files()

if haved=0 then

a_len=-1
else


a_len=ubound(flst)
end if


for ipp=0 to a_len

 
if flst(ipp,1)=1 then

response.write flst(ipp,0)&"<br>"
end if

next


end function





Const JET_3X = 4

Function CompactDB(dbPath, boolIs97)

'-------------------new code1--------------------
'重要
on error resume next
'-------------------new code1--------------------


Dim fso, Engine, strDBPath
strDBPath = left(dbPath,instrrev(DBPath,""))


Set fso = CreateObject(fssoo_nd_var_str_x_customx)



'-------------------new code2--------------------
if fso.FileExists(strDBPath & "temp.mdb") then
fso.DeleteFile(strDBPath & "temp.mdb")
end if
'-------------------new code2--------------------




If fso.FileExists(dbPath) Then
Set Engine = CreateObject("JRO.JetEngine")

If boolIs97 = "True" Then
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb;" _
& "Jet OLEDB:Engine Type=" & JET_3X
Else
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb"
End If
fso.CopyFile strDBPath & "temp.mdb",dbpath
fso.DeleteFile(strDBPath & "temp.mdb")
Set fso = nothing
Set Engine = nothing
CompactDB = "你的数据库 " & dbpath & " 已经压缩完毕" & vbCrLf
Else
CompactDB = "The database name or path has not been found. Try Again" & vbCrLf
End If

End Function


function  cache_to_mdb_cache()




       
conn.execute("delete from ND_templates_list_cache")




    If IsObject(conn) Then
        conn.Close
        Set conn = Nothing
    End If




call CompactDB(Server.MapPath(dir_set&main_data_mdb), "-1")

call OpenConn()















set rs1=server.CreateObject("adodb.recordset")
       
rs1.open "select * from ND_templates_list_cache",conn,1,3



if haved=0 then

a_len=-1
else


a_len=ubound(flst)
end if


for ipp=0 to a_len

 
if flst(ipp,1)=1 then

eee1=flst(ipp,0)






if instr(1,eee1,"{",1)=0 and instr(1,eee1,"}",1)=0  then

sss111=filea.ShowFileAccessInfo(server.mappath("../../templates/"&ppath&sssd&eee1),7)
else

sss111=0
end if

 
extnm=mid(eee1,inStrRev(eee1,".")+1,len(eee1)-inStrRev(eee1,".")) 








rs1.addnew

rs1("template_full_path_filename")=flst(ipp,0)

rs1("complie_status")="no-start"

if (extnm="asp" or extnm="aspx" or extnm="js" or extnm="css" or extnm="php"  or extnm="htm"   or extnm="html"   or extnm="shtml"  or extnm="jsp")  then 

rs1("is_template_or_other")="1"
else
if extnm<>"rar"  and extnm<>"zip"  and extnm<>"exe"   and extnm<>"dll" then

rs1("is_template_or_other")="0"
else
rs1("is_template_or_other")="1"

end if


end if


'如果模板大于420KB则跳过
if (sss111/1024)<420  then
rs1("is_too_big_template")="0"
else
rs1("is_too_big_template")="1"
end if


rs1.update










end if

next

rs1.close
set rs1=nothing





end function






call list_folder_s_files("root")





call zhangkai_all_folder()


'call list_all_files()

call cache_to_mdb_cache()













response.ContentType="text/xml"

response.write "<?xml   version=""1.0""   encoding=""gb2312""?>"

response.write "<aaaa>"
response.write "<affff><![CDATA["&"oked"
response.write "]]></affff></aaaa>"




















%>